package com.raj.sample1;

import java.io.BufferedReader;
import java.io.FileReader;


public class readfile {
   public static void main(String[] args) throws Exception {
      
      String  thisLine = null;
      //Input in = null ;
      try{
         
         BufferedReader br = new BufferedReader( new FileReader("/home/murali/workspace/tryouts-new/src/com/raj/sample1/178loadtest.txt"));
         SNMPSender ssend = new SNMPSender("default",10);
         while ((thisLine = br.readLine()) != null) {
         //  System.out.println(thisLine);
        	  String str = thisLine;
            int startIndex = str.indexOf(",");
            int midIndex = str.indexOf(",.");
            int endIndex = str.length();
            
        String ipadress = str.substring(0,startIndex);
        String commStr = str.substring(startIndex+1,midIndex);
        String oids = str.substring(midIndex+1,endIndex);
       //     System.out.println(oids);
            
            /*String replacement = "";
            String toBeReplaced = str.substring(startIndex , endIndex);
            String oids= str.replace(toBeReplaced, replacement);
           System.out.println(oids);*/
    	    ssend.send(ipadress.trim(), commStr.trim(),oids.trim());
            
                    
            
            
           // in = new Input(thisLine);
           // System.out.println(in.getIpadress() +"" + in.getOid());
         }       
      }catch(Exception e){e.printStackTrace();}
      
   }
}